<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<base href="<%=basePath%>">
		<link href=" themes/css/ui.common.css"
			rel="stylesheet" type="text/css" />
		<link href=" themes/css/ui.child.css"
			rel="stylesheet" type="text/css" />
		<link href=" themes/css/ui.tips.css"
			rel="stylesheet" type="text/css" />
		<link
			href=" style/jquery_ui/jquery-ui-1.8.custom.css"
			rel="stylesheet" type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href=" themes/css/ui.c.blue.css"></link>
		<link rel="stylesheet"
			href=" themes/default/pagination.css"
			type="text/css"></link>
		<script
			src=" Scripts/jquery-1.4.1.min.js"
			type="text/javascript"></script>
		<script
			src=" Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>

		<script src=" Scripts/ui.tips.js"
			type="text/javascript"></script>
		<script src=" Scripts/ui.default.js "
			type="text/javascript" charset="UTF-8"></script>
					<script src=" Scripts/ui.admincp.js"
			type="text/javascript" charset="UTF-8"></script>
		<script src=" js/ui.editableObject.js"
			type="text/javascript"></script>
		<script src=" js/goodsOrderHandler.js"
			type="text/javascript"></script>
		<script
			src="js/bussiness.goodsReturn.js"
			type="text/javascript"></script>
		<STYLE type="text/css">
		.editorArea {
			display: none;
		}
		</STYLE>
		<script type="text/javascript"
			src=" Scripts/ui.dialogFormHelper.js"></script>
			<SCRIPT type="text/javascript">
			var searching = false;
				$(function(){
					$("#link_page_prev,#link_page_next").click(function(){
			    		var currentPage = $(this).attr("currentPage");
			    	 
			    		goToPage(currentPage);
			    	}); 
			    	
			    	$("#searchButton").click(function(){
						searching=true;
			    		goToPage(1);
			    	});
			    	
			    	initSearch();
			    	registeRowFuncButton();
				});
				
				function initSearch()
				{
				    $("#search_title").val();
				    $("#search_publishTime").val();
				    $("#search_staffName").val();
				    $("#search_categoryId").val();
				}
			 
				function goToPage(currentPage)
				{
				    var title = $.trim($("#search_title").val());
				    var publishTime = $.trim($("#search_publishTime").val());
				    var staffName = $.trim($("#search_staffName").val());
				    var categoryId = $.trim($("#search_categoryId").val());
					location.href = "regulationInfo!toManager.action?currpage="+currentPage+"&categoryId="+categoryId+"&title="+title+"&staffName="+staffName+"&publishTime="+publishTime;
				}
			</SCRIPT>
			<SCRIPT type="text/javascript">
				function toDeleteHandler(e)
				{
			   	 	var regulationId = e.entityId;
			     	location="regulationInfo!delete.action?regulationIds="+regulationId+"&currpage="+$("#currentPage").val();
				}
				
				function checkAll(str)
				{
　 					var items = document.getElementsByName(str);　 //获取所有复选框
　					var totalNum = items.length;　 //获取复选框的个数
　 					for (var i=0; i<totalNum; i++)
　 					items[i].checked = window.event.srcElement.checked;//通过单击的按钮判断是选中还是未选
				}
				
				function deleteAll(str)
				{	
					var isTo = checkDeleteAll("规章制度信息记录");

					if(isTo==false)
  					return ;
　 					var items = document.getElementsByName(str);　 //获取所有复选框
　					var totalNum = items.length;　 //获取复选框的个数
					var delStr = "";
　 					for (var i=0; i<totalNum; i++){
　 						if(items[i].checked == true){
							delStr += items[i].value + ","; 
						}
					}
					delStr = delStr.substring(0, delStr.length -1);
					location="regulationInfo!delete.action?regulationIds="+delStr+"&currpage="+$("#currentPage").val();
				}
			</SCRIPT>
	</head>

	<body>
		<div class="PageChild_Title">
			<img src="themes/images/default/icons/archives.png" class="PageChild_Tbtnpic" />
			<span class="PageChild_separate"></span>
			<span class="PageChild_TbtnText"><h2>管理规章制度</h2></span>
			<span class="PageChild_separate"></span>
			<div id="marker" class="red-tips">
			</div>
			<div class="clear">
			</div>
		</div>
		<div class="PageChild_Where">
			<table style="height: 60px;" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td class="mtd">
						规章制度类型:<s:select list="categoryList" listKey="categoryId" listValue="categoryName" headerKey="" headerValue="-请选择-" id="search_categoryId" name="categoryId" theme="simple"></s:select>
					</td>
					<td class="mtd">
						&nbsp;规章制度标题:<input id="search_title" value="${title }">
					</td>
					<td class="mtd">
						&nbsp;规章制度时间:<input id="search_publishTime" class="NeedDate" value="${publishTime }">
					</td>
					<td class="mtd">
						&nbsp;发布人:<input id="search_staffName" value="${staffName }">
					</td>
					<td>
						<input type="submit" name="btn_Serach" value="搜索" id="btn_Serach" class="o-btn" onclick="goToPage(1)" />
					</td>
				</tr>

				<tr>
					<td colspan="5">
						&nbsp;
						<span id="lbl_list_count">共搜索到 <b>${count}</b> 条符合条件的记录。</span>
						&nbsp;
						<input type="button" id="addNewsButton"  value="添 加" class="o-btn SubmitButton" onclick='location="regulationInfo!toAdd.action"' />
					</td>
				</tr>
			</table>
		</div>
		<div class="PageChild_List">
			<table width="100%" border="0" cellspacing="0"
				style="text-align: left">
				<tbody class="PageChild_List_head">
					<tr>
						<td width="16">
							<input id="Chk_All" type="checkbox" name="Chk_All"
								onclick="checkAll('Chk_Num')" />
						</td>
						<td width="16">
							<img src="themes/images/default/icons/pcde_314.png" width="16"
								height="16" />
						</td>
						<td>
							规章制度标题
						</td>
						<td>
							发布时间
						</td>
						<td>
							发布人
						</td>
						<td>
							规章制度类型
						</td>
						<td class="td_width40">
							查看
						</td>
						<td class="td_width40">
							编辑
						</td>
						<td class="td_width40">
							删除
						</td>
					</tr>
				</tbody>
				<tbody class="PageChild_List_main" style="text-align: left">
					<s:if test="infoList != null && infoList.size != 0">
					<s:iterator value="infoList" var="item" status="no">
						<tr class='td_no_bord'>
							<td class="td_width25">
								<span title="24"><input id="Chk_Num" type="checkbox"
										 value="${item.regulationId}" /> </span>
							</td>
							<td class="td_width25">
								<s:property value="#no.count" />
							</td>
							<td>
								<span> ${item.title} </span>&nbsp;
							</td>							
							<td>
								<span>${item.strPublishTime} </span>&nbsp;
							</td>
							<td>
								<span>${item.staffInfo.archiveInfo.staffName} </span>&nbsp;
							</td>
							<td>
								<span>${item.regulationCategory.categoryName}</span>&nbsp;
							</td>
							<td>
								<a> <img src="themes/icons/info.png" title="单击查看规章制度信息" onclick='location="regulationInfo.action?regulationId=${item.regulationId}"'/>
								</a>
							</td>
							<td>
								<a class="ui-link-edit-button" onclick='location="regulationInfo!toEdit.action?regulationId=${item.regulationId}"'>
									<img src="themes/icons/edit.png" title="进行编辑" /> </a> &nbsp;

							</td>
							<td>
								<a href="javascript:void(0);" class="ui-link-delete-button" entityId="${item.regulationId}" onclick=''>
								<img src="themes/icons/delete.png" /> </a>
							</td>
						</tr>
					</s:iterator>
					</s:if><s:else>
						<tr><td colspan="9">无记录</td></tr>
					</s:else>
				</tbody>
			</table>

		</div>
		<div id="divTopPageNavi" class="list_r_title_text3">
		 	<input class="hiddenObject" value="${currpage }" id="currentPage">
			<!--分页导航开始-->
			<s:if test="currpage<=1">
				<span class='list_r_title_text3a'> <img
						src=" themes/images/default/page_up_gray.gif"></img>
				</span>

			</s:if>
			<s:else>
				<span class='list_r_title_text3a'> <a name="link_page_prev"
					id="link_page_prev" href="javascript:void(0);"
					currentPage="${currpage-1}"> <img
							src=" themes/images/default/page_up.gif"></img>
				</a> </span>
			</s:else>
			<span class='list_r_title_text3b'> 第${currpage }页/共${totalpage
				}页 </span>
			<s:if test="currpage>=totalpage">
				<span class='list_r_title_text3a'> <img
						src=" themes/images/default/page_down_gray.gif"></img>
				</span>
			</s:if>
			<s:else>
				<span class='list_r_title_text3a'> <a name="link_page_next"
					id="link_page_next" href="javascript:void(0);"
					currentPage="${currpage+1 }"> <img
							src=" themes/images/default/page_down.gif"></img>
				</a> </span>
			</s:else><span id="goToPageTextArea"><input type="text" class="easyui-numberbox"  id="goPageNum" max="${totalpage}" min="1"/> <input type="button" id="turnToPageButton" value="GO"/></span>
			<!--分页导航结束-->
		</div>
		<div>
			<input type="button" name="btn_Delete" class="o-btn SubmitButton"
				value="删 除" id="btn_Delete"
				onclick="deleteAll('Chk_Num')">
		</div>
	</body>

	
</html>
